package day13;
import java.util.Scanner;

/**
 * 题目:参数解析
 * https://www.nowcoder.com/practice/668603dc307e4ef4bb07bcd0615ea677?tpId=37&&tqId=21297&rp=1&ru=/activity/oj&qru=/ta/huawei/question-ranking
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        int count = 0;
        for (int i = 0; i < str.length(); i++) {
            if(str.charAt(i)== '"') {
                i++;
                while (str.charAt(i) != '"') {
                    i++;
                }
            }
            if(str.charAt(i) == ' ') {
                count++;
            }
        }
        System.out.println(count+1);
        int flag = 1;
        for (int i = 0; i < str.length(); i++) {
            //为判断双引号中的空格
            if(str.charAt(i) == '"') {
                flag ^= 1;
            }
            //既不是双引号也不是空格就都打印
            if(str.charAt(i) != '"' && str.charAt(i) != ' ') {
                System.out.print(str.charAt(i));
            }
            //双引号中的空格继续打印
            if(str.charAt(i) == ' ' && flag == 0) {
                System.out.print(' ');
            }
            //不是双引号中的空格换行
            if(str.charAt(i) == ' ' && flag == 1) {
                System.out.println();
            }
        }
    }
}
